'\" te
.\"  Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SIP_REGISTER_SENT_BY 3SIP "Jan 25, 2007"
.SH NAME
sip_register_sent_by, sip_unregister_sent_by, sip_unregister_all_sent_by \-
allows registering and un-registering sent-by values
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ]
#include <sip.h>

\fBint\fR \fIsip_register_sent_by\fR(\fBchar *\fR\fIval\fR);
.fi

.LP
.nf
\fBvoid\fR \fIsip_unregister_sent_by\fR(\fBchar *\fR\fIval\fR);
.fi

.LP
.nf
\fBvoid\fR \fIsip_unregister_all_sent_by\fR(\fBint *\fR\fIerror\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBsip_register_sent_by()\fR function can be used to register a list of
hostnames or IP addresses that the application may add to the \fBVIA\fR
headers. The \fIval\fR is a comma separated list of such sent-by values. If any
value is registered using \fBsip_register_sent_by()\fR, the \fBSIP\fR stack
validates incoming responses to check if the sent-by parameter in the topmost
\fBVIA\fR header is part of the registered list. If the check fails, the
response is dropped. If there are no sent-by values registered, there is no
check done on incoming responses.
.sp
.LP
The \fBsip_unregister_sent_by()\fR and \fBsip_unregister_all_sent_by()\fR
functions are used to un-register sent-by values. The \fIval\fR for
\fBsip_unregister_sent_by()\fR is a comma separated list of sent-by values that
need to be un-registered. \fBsip_unregister_all_sent_by()\fR un-registers all
the values that have been registered.
.SH RETURN VALUES
.sp
.LP
The \fBsip_register_sent_by()\fR function returns \fB0\fR on success and the
appropriate error value on failure.
.sp
.LP
The value of \fBerrno\fR is not changed by these calls in the event of an
error.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR libsip (3LIB)
